<template>
  <div>
    历史配送单
    <a-card>
      <vxe-grid ref="xGrid" v-bind="gridOptions" v-on="gridEvent">
        <template #description="{ row }">
          <div>
            <div v-for="(desc, ind) in row.description" :key="ind">
              【<span>{{ desc.name }}</span>
              <span>X{{ desc.count }}</span>
              <span>￥{{ desc.price }}</span>】
            </div>
          </div>
        </template>
        <template #state="{ row }">
          {{row.state=="2"?"已接单":""}}
          {{row.state=="3"?"已送达":""}}
        </template>
      </vxe-grid>
    </a-card>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { VxeUI } from 'vxe-pc-ui'
import useDelivery from '@renderer/api/useDelivery.js'
const { gridOptions } = useDelivery()
import XEUtils from 'xe-utils'

const xGrid = ref()
const gridEvent: VxeGridListeners<RowVO> = {
  proxyQuery() {
    const grid = xGrid.value
    // 获取表格中的数据
    // const data = grid.getTableData().fullData;
    // console.log(data);
  },
  proxyDelete() {
    console.log('数据代理删除事件')
  },
  proxySave() {
    console.log('数据代理保存事件')
  }
}
</script>

<style></style>
